import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import java.util.stream.IntStream;

class Robot {

    private static final Integer STEP_SIZE;
    private static final String[] CHARACTER_ARRAY;
    private static final Set<String> ROBOT_HASH_SET;

    static {
        STEP_SIZE = 26;
        ROBOT_HASH_SET = new HashSet<>();
        CHARACTER_ARRAY = new String[]{
                "A",
                "B",
                "C",
                "D",
                "E",
                "F",
                "G",
                "H",
                "I",
                "J",
                "K",
                "L",
                "M",
                "N",
                "O",
                "P",
                "Q",
                "R",
                "S",
                "T",
                "U",
                "V",
                "W",
                "X",
                "Y",
                "Z"
        };
    }

    private String name;

    Robot() {
        this.name = Robot.CreateName();
    }

    private static String CreateName() {
        StringBuilder result = new StringBuilder();

        IntStream.range(0, 2).mapToObj(i -> CHARACTER_ARRAY[(int) (Math.random() * STEP_SIZE)]).forEachOrdered(result::append);
        IntStream.range(0, 3).map(i -> ((int) (Math.random() * 10))).forEachOrdered(result::append);

        String robotName = result.toString();

        if (Robot.ROBOT_HASH_SET.add(robotName)) {
            return robotName;
        }

        return CreateName();
    }

    String getName() {
        if (Objects.equals(this.name, "")) this.name = Robot.CreateName();
        return this.name;
    }

    void reset() {
        this.name = "";
    }
}